package com.lhhu.demo.controller;

import com.lhhu.demo.bean.BookClassify;
import com.lhhu.demo.service.ClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Auther 虎
 * @Data 2021/3/10 12:53
 * @Version 1.0
 */
@RestController
public class ClassifyController {
    @Autowired
    private ClassifyService classifyService;

    @GetMapping("/getAllBookClassify")
    public List<BookClassify> getAllBookClassify(){
        return classifyService.getAllBookClassify();
    }

    @PostMapping("/addOneBookClassify")
    public int addOneBookClassify(String bookClassify){
        return classifyService.addOneBookClassify(bookClassify);
    }

    @GetMapping("/getOneBookClassifyById")
    public String getOneBookClassifyById(String bookClassifyId){
        return classifyService.getOneBookClassifyById(bookClassifyId);
    }
}
